1. Field of the Invention
This invention relates in general to computer-implemented database systems, and, in particular, to a technique for cross-platform subselect metadata extraction.
2. Description of Related Art
Databases are computerized information storage and retrieval systems. A Relational Database Management System (RDBMS) is a database management system (DBMS) which uses relational techniques for storing and retrieving data. Relational databases are organized into tables which consist of rows and columns of data. The rows are formally called tuples or records. A database will typically have many tables and each table will typically have multiple tuples and multiple columns. The tables are typically stored on direct access storage devices (DASD), such as magnetic or optical disk drives for semi-permanent storage.
In a DBMS, data records are stored in table spaces. A table space may contain one or more tables. Each table space contains a number of space map pages. Each space map page covers a number of data pages. One or more records can be stored in a single data page. All data pages within a single table space must have the same page size. Typically, a page contains 4096 bytes.
Some current systems provide a technique for obtaining column names and data types of a table or a query result. For example, the DB2® Universal Database (UDB) system from International Business Machines, Corporation has a DESCRIBE command for use in defining a result set (i.e., a query result). In particular, the DESCRIBE command lists column names and data types of a query result (i.e., a result set). The DB2® UDB system supports the DESCRIBE command for various platforms or operating systems, including UNIX®, Windows NT®, and OS/2® platforms and enables a developer to access table, view, or query metadata information. Metadata information comprises information about other information. For example, metadata provides type information about columns in a table.
SQLJ is a set of standards used to define how the Java™ programming language can be used with the Structured Query Language (SQL). SQLJ enables developers to use Java™ data types or classes as data types in SQL. Therefore, relational tables accessed within an SQLJ application may contain columns having Java™ data types or classes. A SQLJ stored procedure is considered a specialized type of SQLJ application. Additionally, a SQLJ iterator describes columns for a result set using Java™ types.
On the other hand, some systems do not provide such techniques for obtaining the types of a result set. The DB2® Version 5 of the OS/390® platform, on the other hand, does not have a DESCRIBE command. However, a developer can alter the Data Manipulation Language (DML) statement so that it returns no data, but allows full access to the metadata similar to that provided in the above DESCRIBE command.
The types of a result set is useful and desirable information. There is a need in the art of an improved technique of obtaining this information, across platforms.